import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int data[]={0,1,0,3,12};
        while (s.hasNext()){
            String s1=s.nextLine();
            System.out.println(Others.isValid(s1));
        }
    }


}
